// <template>
    <div>
        <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/start' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>数据列表</el-breadcrumb-item>
        <el-breadcrumb-item>账号列表</el-breadcrumb-item></el-breadcrumb>
 
    <el-table
    :data="user"
    border
    style="width: 100%;height:450px;overflow:auto;">    
     <el-table-column type="index"></el-table-column>
       <el-table-column
      prop="id"
      label="用户名"
      width="200">
    </el-table-column>
    <el-table-column
      label="用户简介"
      prop="name"
      width="400">
    </el-table-column>
    <el-table-column
      prop="fans"
      label="粉丝数"
      width="100">
    </el-table-column>
    <el-table-column
      prop="attention"
      label="发博数"
      width="100">
    </el-table-column>
<el-table-column label="用户地址" width="400" show-overflow-tooltip>
  <template slot-scope="scope">
    <a :href="scope.row.weibo" target="_blank" class="buttonText">用户主页</a>
  </template>
</el-table-column>
  </el-table>
  
<el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pageCurrent"
      :page-sizes="[10, 25, 50, 100]"
      layout="total, sizes, prev, pager, next, jumper"
      :page-size="pageSize"
      :total="totalCount">
    </el-pagination>

    </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'User_list',
  data () {
    return {
      user:[],
      totalCount:0,
      pageSize:10,
      pageCurrent:1
    }
  },
  methods: {
    getUser_list () {
      const path = `http://127.0.0.1:5000/user_list`
      var data = {"pageSize":this.pageSize, "pageCurrent":this.pageCurrent}
      axios.post(path,data)
        .then(response => {
          // alert(response.data.config)
          // console.log(response)
          this.user = response.data.user.data
          this.pageSize = response.data.user.pageSize
          this.totalCount = response.data.user.totleCount
          console.log(this.user)
        })
        .catch(error => {
          console.log(error)
        })
    },
     handleSizeChange(val) {
       console.log(val)
       this.pageSize = val
       this.getUser_list()
      },
      handleCurrentChange(val) {
         this.pageCurrent = val
        this.getUser_list()
      }
  },
  
  created () {
    this.getUser_list()
  }
}
</script>

<style>

</style>
